const {defineConfig} = require('@vue/cli-service')
const path = require("path");
module.exports = defineConfig({
    pwa: {
        iconPaths: {
            favicon32: 'favicon.ico',
            favicon16: 'favicon.ico',
            appleTouchIcon: 'favicon.ico',
            maskIcon: 'favicon.ico',
            msTileImage: 'favicon.ico'
        }
    },
    publicPath: '/realexam',
    transpileDependencies: true,
    devServer: {
        open: true,
        port: 8001,
        proxy: {
            '/realmock': {
                target: 'http://www.wsavs.com/',
                ws: false,
                changeOrigin: true,
                // pathRewrite: {
                //     '^/realmock': ''  // rewrite path
                // }
            },
            '/api': {
                target: 'http://localhost:81/',
                ws: false,
                changeOrigin: true,
                // pathRewrite: {
                //     '^/apis': ''  // rewrite path
                // }
            },
        }
    },
    chainWebpack: (config) => {
        config.resolve.alias
            .set('@', path.resolve('src'))
            .set('assets', path.resolve('src/assets'))
            .set('components', path.resolve('src/components'))
            .set('static', path.resolve('src/static'))
    }
    // css: {
    //   loaderOptions: {
    //     stylus: {
    //       additionalData: `
    //         // @import "@/assets/stylus/variable.styl";
    //         // @import "@/assets/stylus/mixin.styl";
    //       `
    //     }
    //   }
    // }
})
